#include<bits/stdc++.h>
using namespace std;
int n,m,k,head[100005],cnt,a[100005],g[100005],siz[100005],f[100005],ans,vis[100005],dep[100005],s[100005],tot,s2[100005],tot2;
struct need{
	int a,b;
}v[100005];
struct node{
	int to,next;
}e[200005];
void add(int u,int v){
	e[++cnt].next=head[u];
	head[u]=cnt; e[cnt].to=v;
}
void dfs(int x,int fa){
	if(g[x]==1) siz[x]=x;
	else siz[x]=0;
	f[x]=fa; vis[x]=1; dep[x]=dep[f[x]]+1;
	for(int i=head[x];i>0;i=e[i].next){
		if(e[i].to==fa || vis[e[i].to]==1) continue;
		dfs(e[i].to,x);
		// cout<<" > "<<x<<" ("<<siz[x]<<") : "<<e[i].to<<" ("<<siz[e[i].to]<<") \n";
		if(siz[e[i].to]==0) continue;
		else {
			if(siz[x]==0) siz[x]=siz[e[i].to];
			else {
				v[++ans].a=siz[e[i].to];
				v[ans].b=siz[x];
				siz[x]=siz[e[i].to]=0;
			}
		}
	}
}
signed main(){
	freopen("travel.in","r",stdin);
	freopen("travel.out","w",stdout);
	ios::sync_with_stdio(0);
	cin.tie(0); cout.tie(0);
	cin>>n>>m>>k;
	for(int i=1;i<=n;i++) head[i]=-1;
	for(int i=1;i<=m;i++){
		int u,v;
		cin>>u>>v;
		add(u,v); add(v,u);
	}
	for(int i=1;i<=k;i++) cin>>a[i],g[a[i]]=1;
	for(int i=1;i<=n;i++){
		if(vis[i]==0){
			// cout<<" > "<<i<<" "<<0<<'\n';
			dfs(i,0);
		}
	}
	cout<<ans<<'\n';
	for(int i=1;i<=ans;i++){
		int x=v[i].a,y=v[i].b,LCA; tot=0; tot2=0;
		while(dep[f[x]]>=dep[y]) x=f[x];
		while(dep[f[y]]>=dep[x]) y=f[y];
		while(x!=y) {x=f[x]; y=f[y];}
		LCA=x; x=v[i].a,y=v[i].b;
		while(x!=LCA){
			s[++tot]=x;
			x=f[x];
		}
		while(y!=LCA){
			s2[++tot2]=y;
			y=f[y];
		}
		cout<<tot+tot2+1<<" ";
		for(int j=1;j<=tot;j++) cout<<s[j]<<" "; cout<<LCA<<" ";
		for(int j=tot2;j>=1;j--) cout<<s2[j]<<" "; cout<<'\n';
	}
	return 0;
}